package k2_oop.p7_javaLang.demo03;

import java.util.Random;

public class UseThrow {

    public static void test1(){

        Random random = new Random();
        int num = random.nextInt();

        if(num<=0){
            throw new SunTemperatureException("太阳的温度不能为负数");
        }
    }

    public static void main(String[] args) {
        test1();
    }

}
